﻿@using ECG.Utility
@model List<ECG.Common.NewsCategoryListMenuDto>

@if (Model.Any())
{
    var MenuParent = Model.Where(m => m.ParentId == 0);
    <div class="box-news-cate">
        @foreach (var item in MenuParent)
        {
            var childItem = Model.Where(m => m.ParentId == item.Id);
            var nCateLink = Url.Action("ListNewsCateHome", "News", new { id = item.Id, catename = StringUtil.RemoveSpecialCharactersVn(item.CateName) });
            <div class="cate-title">
                <h3><a href="@nCateLink" class="news-l1">@item.CateName</a></h3>
            </div>
            if (childItem.Any())
            {
                foreach (var itemChild in childItem)
                {
                    var nCateLinkChild = Url.Action("ListNewsCateHome", "News", new { id = itemChild.Id, catename = StringUtil.RemoveSpecialCharactersVn(itemChild.CateName) });
            <div class="cate-title">
                <h4><a href="@nCateLinkChild">@itemChild.CateName</a></h4>
            </div>
                }
            }
        }
    </div>
}


@*<div class="cate-title"><a href="#">Mang thai</a></div>
    <div class="cate-title"><a href="#">Sơ sinh</a></div>
    <div class="cate-title"><a href="#" class="news-l1">Cẩm nang làm mẹ</a></div>
    <div class="cate-title"><a href="#">Bệnh thường gặp</a></div>
    <div class="cate-title"><a href="#" class="news-l1">Gia đình</a></div>
    <div class="cate-title"><a href="#">Mẹ chồng nàng dâu</a></div>
    <div class="cate-title"><a href="#" class="news-l1">Mua sắm</a></div>
    <div class="cate-title"><a href="#">Tư vấn mua sắm</a></div>*@